
#!/bin/sh
docker stop wt-plg-bin-t
PIDST=$!
wait $PIDST

docker rm wt-plg-bin-t
PIDA=$!
wait $PIDA

docker rmi wt-plg-bin:0.0.4 
PIDS=$!
wait $PIDS


docker build -t wt-plg-bin:0.0.4 -f Dockerfile.test .

PID=$!

wait $PID

STATUS=$?

echo "命令的退出状态: $STATUS"
if [ $STATUS -eq 0 ]; then 
    
    docker run --name wt-plg-bin-t -p 3000:3000 -it --rm -d wt-plg-bin:0.0.4 

    PIDR=$!

    wait $PIDR
    echo "容器启动"
    

    # 获取容器的退出状态
else
    echo "命令执行失败"

fi
